import { RequestData, GET, POST } from '@/utils/request-data';

const requestData = Object.create(RequestData);
requestData.setBaseUrl('/erp/dealer');

export const userInfo = token => requestData.base(`/common/user/info/${token}`, POST);
export const uploadFile = formData => requestData.base('/common/upload/file', POST, formData);
export const uploadFiles = params => requestData.base('/debug/download', GET, params, false, true);
export const countryCode = code => requestData.base(`/common/country/${code}`, POST);
export const countries = () => requestData.base('/common/countries', POST);
export const freightList = params => requestData.base('/common/freight', POST);
export const bannerList = params => requestData.base('/common/banner/list', POST);

// 订单统计
export const countryStat = params => requestData.base('/product/order/stat/country/distribution', POST, params);
export const statusStat = params => requestData.base('/product/order/stat/status/distribution', POST, params);
export const amountStat = params => requestData.base('/product/order/stat/total/amount', POST, params);
export const storeAmountStat = id => requestData.base(`/product/order/stat/amount/${id}`, POST);
export const storeQuantityStat = id => requestData.base(`/product/order/stat/quantity/${id}`, POST);
export const storeStatusStat = id => requestData.base(`/product/order/stat/status/${id}`, POST);
// 店铺列表
export const storeAuthorList = params => requestData.base('/store/list', POST, params);
export const storePush = params => requestData.base('/store/product/push', POST, params);
export const uploadToken = () => requestData.base('/common/upload/token', POST);
